package com.fang.fen.test.proxy.staticstate;

public class ProxyCook implements ICook {

    private ICook targetCook;

    public ProxyCook(ICook cook) {
        targetCook = cook;
    }

    public String getName() {
        return "代理厨师";
    }

    public void cooking() {

        System.out.print("我是" + getName());
        System.out.println("，我准备代理" + targetCook.getName() + "做菜");
        targetCook.cooking();
        System.out.println("完成" + targetCook.getName() + "的中国菜");
    }

}
